package ar.edu.itba.cg.util;

import ar.edu.itba.cg.Bowling;

import com.jme.image.Texture;
import com.jme.scene.state.TextureState;
import com.jme.system.DisplaySystem;
import com.jme.util.TextureManager;

public class TextureUtil {

	public static TextureState getTexture(DisplaySystem display, String texture){
		TextureState ts2 = display.getRenderer().createTextureState();
		Texture t2 = TextureManager.loadTexture(
				Bowling.class.getClassLoader().getResource(
				"resources/" + texture),
				Texture.MinificationFilter.Trilinear,
				Texture.MagnificationFilter.Bilinear);
		t2.setWrap(Texture.WrapMode.Repeat);
		ts2.setTexture(t2);
		ts2.setEnabled(true);
		
		return ts2;
	}
}
